function clearElement(id){
	div = document.getElementById(id);
	while(div.hasChildNodes()){
		div.removeChild(div.childNodes[0]);
	}
}

//clearElement('content')